package cn.topkinson.web.a;

import cn.topkinson.web.a.component.WebConsumer;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

import java.io.IOException;

/**
 * @author 黄子濠
 * @date 2020/8/30 21:47
 */
@SpringBootApplication
@EnableDubbo
public class WebAMain {
    public static void main(String[] args) throws IOException {
        SpringApplication.run(WebAMain.class, args);

        /*AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ConsumerConfiguration.class);
        context.start();
        WebConsumer service = context.getBean(WebConsumer.class);
        while (true) {
            System.in.read();
            try {
                String hello = service.sayHello("world",0);
                System.out.println("result :" + hello);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }*/
    }

    /*@Configuration
    @PropertySource("classpath:/dubbo-consumer.properties")
    @ComponentScan("cn.topkinson.web.a.component")
    @EnableDubbo
    static class ConsumerConfiguration {

    }*/
}
